import request from '@/utils/request'

// 获取客户列表
export function getClientsList(params) {
  return request({
    url: '/clients',
    method: 'get',
    params
  })
}

// 获取客户数量
export function getClientsNum(params) {
  return request({
    url: '/clients/count',
    method: 'get',
    params
  })
}

// 获取指定客户
export function getClientsById(id) {
  return request({
    url: `/clients/${id}`,
    method: 'get'
  })
}

// 获取经纪数据
export function getAgents(params) {
  return request({
    url: '/agents',
    method: 'get',
    params
  })
}

// 编辑客户
export function upClients(data) {
  return request({
    url: `/clients/${data.id}`,
    method: 'put',
    data
  })
}

// 新增客户
export function addClients(data) {
  return request({
    url: '/clients',
    method: 'post',
    data
  })
}

// 删除客户
export function delClients(id) {
  return request({
    url: `/clients/${id}`,
    method: 'delete'
  })
}
